using System;
using System.Collections.Generic;
using System.Text;
namespace MyDMS.BusinessLayer
{
	public class ProjectTask: BusinessObjectBase
	{

		#region InnerClass
		public enum ProjectTaskFields
		{
			Task_Code,
			Task_Title,
			Task_Desc,
			Task_Duration,
			Open_Date,
			Open_By,
			DeadLine,
			Assigned_To,
			Closed_Date,
			Closed_By,
			Project_Code,
			Is_Active,
			Creation_Date,
			Updation_Date
		}
		#endregion

		#region Data Members

			int _task_Code;
			string _task_Title;
			string _task_Desc;
			DateTime? _task_Duration;
			DateTime _open_Date;
			int _open_By;
			DateTime? _deadLine;
			int? _assigned_To;
			DateTime? _closed_Date;
			string _closed_By;
			int _project_Code;
			bool? _is_Active;
			DateTime? _creation_Date;
			DateTime? _updation_Date;

		#endregion

		#region Properties

		public int  Task_Code
		{
			 get { return _task_Code; }
			 set
			 {
				 if (_task_Code != value)
				 {
					_task_Code = value;
					 PropertyHasChanged("Task_Code");
				 }
			 }
		}

		public string  Task_Title
		{
			 get { return _task_Title; }
			 set
			 {
				 if (_task_Title != value)
				 {
					_task_Title = value;
					 PropertyHasChanged("Task_Title");
				 }
			 }
		}

		public string  Task_Desc
		{
			 get { return _task_Desc; }
			 set
			 {
				 if (_task_Desc != value)
				 {
					_task_Desc = value;
					 PropertyHasChanged("Task_Desc");
				 }
			 }
		}

		public DateTime?  Task_Duration
		{
			 get { return _task_Duration; }
			 set
			 {
				 if (_task_Duration != value)
				 {
					_task_Duration = value;
					 PropertyHasChanged("Task_Duration");
				 }
			 }
		}

		public DateTime  Open_Date
		{
			 get { return _open_Date; }
			 set
			 {
				 if (_open_Date != value)
				 {
					_open_Date = value;
					 PropertyHasChanged("Open_Date");
				 }
			 }
		}

		public int  Open_By
		{
			 get { return _open_By; }
			 set
			 {
				 if (_open_By != value)
				 {
					_open_By = value;
					 PropertyHasChanged("Open_By");
				 }
			 }
		}

		public DateTime?  DeadLine
		{
			 get { return _deadLine; }
			 set
			 {
				 if (_deadLine != value)
				 {
					_deadLine = value;
					 PropertyHasChanged("DeadLine");
				 }
			 }
		}

		public int?  Assigned_To
		{
			 get { return _assigned_To; }
			 set
			 {
				 if (_assigned_To != value)
				 {
					_assigned_To = value;
					 PropertyHasChanged("Assigned_To");
				 }
			 }
		}

		public DateTime?  Closed_Date
		{
			 get { return _closed_Date; }
			 set
			 {
				 if (_closed_Date != value)
				 {
					_closed_Date = value;
					 PropertyHasChanged("Closed_Date");
				 }
			 }
		}

		public string  Closed_By
		{
			 get { return _closed_By; }
			 set
			 {
				 if (_closed_By != value)
				 {
					_closed_By = value;
					 PropertyHasChanged("Closed_By");
				 }
			 }
		}

		public int  Project_Code
		{
			 get { return _project_Code; }
			 set
			 {
				 if (_project_Code != value)
				 {
					_project_Code = value;
					 PropertyHasChanged("Project_Code");
				 }
			 }
		}

		public bool?  Is_Active
		{
			 get { return _is_Active; }
			 set
			 {
				 if (_is_Active != value)
				 {
					_is_Active = value;
					 PropertyHasChanged("Is_Active");
				 }
			 }
		}

		public DateTime?  Creation_Date
		{
			 get { return _creation_Date; }
			 set
			 {
				 if (_creation_Date != value)
				 {
					_creation_Date = value;
					 PropertyHasChanged("Creation_Date");
				 }
			 }
		}

		public DateTime?  Updation_Date
		{
			 get { return _updation_Date; }
			 set
			 {
				 if (_updation_Date != value)
				 {
					_updation_Date = value;
					 PropertyHasChanged("Updation_Date");
				 }
			 }
		}


		#endregion

		#region Validation

		internal override void AddValidationRules()
		{
			ValidationRules.AddRules(new Validation.ValidateRuleNotNull("Task_Code", "Task_Code"));
			ValidationRules.AddRules(new Validation.ValidateRuleNotNull("Task_Title", "Task_Title"));
			ValidationRules.AddRules(new Validation.ValidateRuleStringMaxLength("Task_Title", "Task_Title",100));
			ValidationRules.AddRules(new Validation.ValidateRuleNotNull("Task_Desc", "Task_Desc"));
			ValidationRules.AddRules(new Validation.ValidateRuleStringMaxLength("Task_Desc", "Task_Desc",2147483647));
			ValidationRules.AddRules(new Validation.ValidateRuleNotNull("Open_Date", "Open_Date"));
			ValidationRules.AddRules(new Validation.ValidateRuleNotNull("Open_By", "Open_By"));
			ValidationRules.AddRules(new Validation.ValidateRuleStringMaxLength("Closed_By", "Closed_By",10));
			ValidationRules.AddRules(new Validation.ValidateRuleNotNull("Project_Code", "Project_Code"));
		}

		#endregion

	}
}
